﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<SDT.Site.ViewModels.ProductListModels>" %>
<%@ Import Namespace="SDT.Lib.Helpers" %>
<div class="title_col3"><h2><a href="/product/index/1">Nhà đất bán - Nhà đất cho thuê</a></h2></div>
<div class="line_tab mar_b"></div>
<%--<div class="boxtitle"><a href="/product/index/1">Nhà đất bán - Nhà đất cho thuê</a></div>--%>
<div class="clear"></div>
<div class="prd_pad_cnt" style="padding:1px">
   <table class="tbl_tin" width="100%" border="0" cellpadding="5" cellspacing="0">
      <tr class="tbl_tin_tit">
        <td width="61px">Ngày</td>
        <td>Tiêu đề</td>
        <td width="110px">Quận/ Huyện</td>
        <td width="56px">Diện tích (m2)</td>
        <td width="90px">Giá</td>
        <td width="56px">Mã tin</td>
      </tr>
      <%foreach (var item in Model.Products)
        { %>
      <tr align="center">
        <td><%=item.AddDate.Value.ToString("dd/MM/yyyy") %></td>
        <td style="text-align:justify"> <a href="/product/details/<%=item.ID %>/<%=Html.ToUrlFriendly(item.Title)%>">
               <%=Html.Encode(item.Title)%>
            </a>
        </td>
        <td><%=Html.Encode(item.District.Name)%>&nbsp;-&nbsp;
            <%=Html.Encode(item.City.Name)%>
        </td>
        <td><%=item.Area %></td>
        <td><%=item.Cost != null && item.Cost > 0 ? SDT.Lib.Common.Utils.ReadNumber((double)item.Cost) +"&nbsp;" + (item.CurrencyID.HasValue && item.CurrencyID.Value == SDT.Lib.Common.CurrencyType.USD ? "USD" : string.Empty) + item.UnitCost : "Thỏa thuận"%></td>
        <td><span class="t_org">PL</span><%=item.ID %></td>
      </tr>
      <%} %>
    </table>
   
   <%-- <div style="float: left; width: 335px; margin-right: 7px">
        <%var total = Model.Products.Count;
              int totaRight = total / 2;
              int totalLeft = total -totaRight;
              if (totalLeft > 0)
            { %>
   	          <%for (int i = 0; i < totalLeft; i++)
                {
                 %>
   	                <div class="prd_pad_cnt">
                        <div style="" class="tin_img">
                            <a href="/product/details/<%=Model.Products[i].ID %>/<%=Html.ToUrlFriendly(Model.Products[i].Title)%>">
                                <% string imgPath = (Model.Products[i].ImagePath != null && Model.Products[i].ImagePath != string.Empty) ? SDT.Lib.Common.Utils.GenThumbnail(Model.Products[i].ID, 102, 78, Model.Products[i].ImagePath, Model.ImagePath, Model.ImageUrl) : SDT.Lib.Common.Globals.DefaultLogo; %>
                                <img src="<%=imgPath %>" title="" alt="<%=Model.Products[i].Title %>" width="102" height="78" class="bor_img" />
                            </a>
                        </div>
                        <div style="" class="tin_cnt">
                            <div>
                                <a href="/product/details/<%=Model.Products[i].ID %>/<%=Html.ToUrlFriendly(Model.Products[i].Title)%>">
                                   <strong><%=Html.Encode(Model.Products[i].Title)%></strong> 
                                </a>
                                <img src="/images/green/vip.gif" />
                            </div>
                            <div class="datetime"><%=Model.Products[i].AddDate.Value.ToString("dd/MM/yyyy") %></div>
                            <div><strong>Vị trí</strong>: <%=Html.Encode(Model.Products[i].District.Name)%>,&nbsp;
                                                          <%=Html.Encode(Model.Products[i].City.Name)%></div>
                            <div><strong>Giá</strong>: <span class="t_org"><%=Model.Products[i].Cost != null && Model.Products[i].Cost > 0 ? SDT.Lib.Common.Utils.ReadNumber((double)Model.Products[i].Cost) + "&nbsp;" + Model.Products[i].UnitCost : "Thỏa thuận"%></span></div>
                         </div>
                         <div class="clear"></div>
                  </div>  
               <%} %>
          <%} %>
    </div>
    <div style="float: left; width: 335px;">
        <%if (totaRight > 0)
                { %>
       	          <%for (int i = totalLeft; i < Model.Products.Count; i++)
                    {                        
                     %>
                     <div class="prd_pad_cnt">
                        <div style="" class="tin_img">
                            <a href="/product/details/<%=Model.Products[i].ID %>/<%=Html.ToUrlFriendly(Model.Products[i].Title)%>">
                                <% string imgPath = (Model.Products[i].ImagePath != null && Model.Products[i].ImagePath != string.Empty) ? SDT.Lib.Common.Utils.GenThumbnail(Model.Products[i].ID, 102, 78, Model.Products[i].ImagePath, Model.ImagePath, Model.ImageUrl) : SDT.Lib.Common.Globals.DefaultLogo; %>
                                <img src="<%=imgPath %>" title="" alt="<%=Model.Products[i].Title %>" width="102" height="78" class="bor_img" />
                            </a>
                        </div>
                        <div style="" class="tin_cnt">
                            <div>
                                <a href="/product/details/<%=Model.Products[i].ID %>/<%=Html.ToUrlFriendly(Model.Products[i].Title)%>">
                                   <strong><%=Html.Encode(Model.Products[i].Title)%></strong> 
                                </a>
                                <img src="/images/green/vip.gif" />
                            </div>
                            <div class="datetime"><%=Model.Products[i].AddDate.Value.ToString("dd/MM/yyyy") %></div>
                            <div><strong>Vị trí</strong>: <%=Html.Encode(Model.Products[i].District.Name)%>,&nbsp;
                                                          <%=Html.Encode(Model.Products[i].City.Name)%></div>
                            <div><strong>Giá</strong>: <span class="t_org"><%=Model.Products[i].Cost != null && Model.Products[i].Cost > 0 ? SDT.Lib.Common.Utils.ReadNumber((double)Model.Products[i].Cost) + "&nbsp;" + Model.Products[i].UnitCost : "Thỏa thuận"%></span></div>
                         </div>
                         <div class="clear"></div>
                  </div>  
                      <%} %>
              <%} %>
    </div>--%>
</div>
